#ifndef __BLDC_conditon_judgement_H__
#define __BLDC_conditon_judgement_H__
#include "math.h"
#include "pid_controller.h"
#include "hal_uart.h"
#include "HAL_device.h" // Device header
#include "hal_gpio.h"
//#include "Whole_Motor_Structure.h"
#include "hal_rcc.h"
#include "Whole_Motor_Parameters.h"
//#include "Sin_table.h"
#include <stdio.h>
#include "motor_status.h"
#include "BLDC_change.h"
#include "BLDC_voltage_condition.h"
#include "time_manager.h"
void adc_count_clean(void);
void set_condition_judgement_setting(u16 condition_judgement_setting_in);
void change_to_use_inside_calculate_reserving(void);
void set_limit_reserving_time(pid_virables *pid_position_controller, double kp_in, double ki_in, double kd_in, u16 limit_reserving_time_in);
void set_motor_derection(char motor_derection_in);
void Use_up_and_down_voltage_to_control_reversing(void);
void BLDC_condition_judgement_check_watching(void);
void pole_status_set_check_before_update(void);
void pole_status_set_check_voltage_classification(void);
void check_rise_down_error_voltage(void);
void set_auto_rise_duty_virable(double error_check_double_input, double error_check_number_input, u32 duty_add_per_cycle_input, u32 duty_limit_setting_input);
void auto_rise_duty(void);
void set_current_target_for_torque(int current_target_min_in, int current_target_max_in);
void pole_status_begin_get_voltage(void);
void pole_status_end_get_voltage(void);
void calculate_new_check_time(void);
void pole_status_mid_get_voltage(void);
void pole_end_get_current(void);
// void set_current_target_for_torque(int current_target_for_torque_in);
void check_certain_stage_error_current(void);
void get_max_current(void);
void get_and_check_crossing_time(void);
void checked_crossing_error(void);
void params_set_init(void);
void all_times_error_sum(void);
#endif /* __BLDC_conditon_judgement_H__ */
